home *** CD-ROM | disk | FTP | other *** search
- WMSORTSD.MOD
- Vortex Rouge #163 @5853
- Thu, Dec 5, 1991 5:09 pm
- ------- --------- -------------- -------------- ---
- -------- -------- --- A mod from the Winds Master ----- ----
- ----- ----- ---------- The Whirlwind of Information ----- ---
- ----- ------- ------- 8 pm Friday to 6 am Monday, ----- ----
- ------- ------------ (Weekends ONLY!) 765-3093. ------ -----
- ---- ------- ------ ---------
- -------- ------------- I can be reached at 93 @5851 --------- ---
- ----- -------- ---- ------- --------- --------- ------
-
-
- WMSORTSD.MOD
-
- DESCRIPTION: This mod sorts your subs and directories
-
- This is a pretty simple mod that I created a little while ago and just
- now decided to distribute. I am actually amazed that no one already made
- a mod to do the same thing this one does.
-
- As it says above, it sorts the subs and dirs, like this:
-
- instead of
-
- 1 - General
- 2 - War Sub
- 3 - Ansi
- 4 - For Sale
-
- it would be like this:
-
- 1 - General
- 2 - Ansi
- 3 - For Sale
- 4 - War Sub
-
- NOTE: I have made this mod skip the first sub 'cause I always like my
- general sub first, but if you do not want it to do that it is easy to fix.
-
- This mod does not change the order of any information on disk, only what
- is in memory (specifically, what is in usub and udir)
-
- ON WITH THE MOD!!
-
- key
- = original code
- + added line
-
- all changes are in UTILITY.C to function changedsl()
-
- = if ((s.anony & anony_ansi_only) && (!okansi()))
- = ok=0;
- = if (ok)
- = {
- = if ((i1 % 10)==0)
- = dc[dp++]=('0'+(i1/10));
- = itoa(i1++,s1.keys,10);
- = s1.subnum=i;
- = usub[i2++]=s1;
- = }
- = }
- + for (i=1; i<i2; i++) /* see note */
- + for (i1=i; i1<i2; i1++)
- + if (strcmp(subboards[usub[i].subnum].name,
- + subboards[usub[i1].subnum].name) > 0)
- + {
- + i3=usub[i].subnum;
- + usub[i].subnum=usub[i1].subnum;
- + usub[i1].subnum=i3;
- + }
- = i1=1;
- = i2=0;
- = for (i=0; i<num_dirs; i++) {
- = ok=1;
- = d=directories[i];
- = if (thisuser.dsl<d.dsl)
- = ok=0;
- = if (thisuser.age<d.age)
- = ok=0;
- = if (d.dar)
- = if ((d.dar & thisuser.dar)==0)
- = ok=0;
- = if (ok) {
- = s1.subnum=i;
- = if (i==0)
- = strcpy(s1.keys,"0");
- = else {
- = if ((i1 % 10)==0)
- = dcd[ddp++]=('0'+(i1/10));
- = itoa(i1++,s1.keys,10);
- = }
- = udir[i2++]=s1;
- = }
- = }
- =
- + for (i=1; i<i2; i++) /* see note */
- + for (i1=i; i1<i2; i1++)
- + if (strcmp(directories[udir[i].subnum].name,
- + directories[udir[i1].subnum].name) > 0)
- + {
- + i3=udir[i].subnum;
- + udir[i].subnum=udir[i1].subnum;
- + udir[i1].subnum=i3;
- + }
- =
- = dcd[ddp]=0;
- = dc[dp]=0;
- = }
-
- NOTE: Both for (i=1's are so it skips the first sub and first sub, since
- this is usually the General Sub/Sysop Dir which are usually wanted first.
- If you would like to skip the first two subs/dirs just change the 1 to 2,
- but if you would rather not skip any and alphabeticalize everything, change
- it to a 0.
-
- One more note, I may have made some minor changes to the small areas of
- code above the area marked to be read in, but the changes (if any) were
- only to disreguard the keys variable 'cause I did not think the mod would
- work correctly if you used it, but it does work completely.
-
-
- FINAL NOTE:
- As of right now, I am not allowed to use the computer till January 1st.
- (parent's aren't home). Even though I will be allowed to use the computer
- and set my board back up after Jan 1 I am not planning on it. This mod may
- be the last mod I will distribute. If I find a time in the future, I may
- pull another mod from my source and post it. I do have many undistributed
- mods that just might trickle out, but I will not create any more.
-
-
- Samuel R. Neff
-
- 7 <<=-- The Dark Side of the Moon BBS --=>>
- 5 <<=-- Phone: 518-237-0489 Node: 5853 --=>>
- 2 <<=-- Home of 'The Gunners Dream' <Hunting/Gun Control> NET --=>>